\(\int \sec ^4(e+f x) (a+b \sin ^2(e+f x))^2 \, dx\) [297]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 45 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=b^2 x+\frac {\left (a^2-b^2\right ) \tan (e+f x)}{f}+\frac {(a+b)^2 \tan ^3(e+f x)}{3 f} \]

[Out]

b^2*x+(a^2-b^2)*tan(f*x+e)/f+1/3*(a+b)^2*tan(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3270, 398, 209} \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {\left (a^2-b^2\right ) \tan (e+f x)}{f}+\frac {(a+b)^2 \tan ^3(e+f x)}{3 f}+b^2 x \]

[In]

Int[Sec[e + f*x]^4*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

b^2*x + ((a^2 - b^2)*Tan[e + f*x])/f + ((a + b)^2*Tan[e + f*x]^3)/(3*f)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 398

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 3270

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+(a+b) x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (a^2-b^2+(a+b)^2 x^2+\frac {b^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {\left (a^2-b^2\right ) \tan (e+f x)}{f}+\frac {(a+b)^2 \tan ^3(e+f x)}{3 f}+\frac {b^2 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f} \\ & = b^2 x+\frac {\left (a^2-b^2\right ) \tan (e+f x)}{f}+\frac {(a+b)^2 \tan ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.31 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {3 b^2 \arctan (\tan (e+f x))+(a+b) (2 a-b+(a-2 b) \cos (2 (e+f x))) \sec ^2(e+f x) \tan (e+f x)}{3 f} \]

[In]

Integrate[Sec[e + f*x]^4*(a + b*Sin[e + f*x]^2)^2,x]

[Out]

(3*b^2*ArcTan[Tan[e + f*x]] + (a + b)*(2*a - b + (a - 2*b)*Cos[2*(e + f*x)])*Sec[e + f*x]^2*Tan[e + f*x])/(3*f
)

Maple [A] (verified)

Time = 1.06 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.69

method result size
derivativedivides \(\frac {-a^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+\frac {2 a b \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}+b^{2} \left (\frac {\left (\tan ^{3}\left (f x +e \right )\right )}{3}-\tan \left (f x +e \right )+f x +e \right )}{f}\) \(76\)
default \(\frac {-a^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+\frac {2 a b \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}+b^{2} \left (\frac {\left (\tan ^{3}\left (f x +e \right )\right )}{3}-\tan \left (f x +e \right )+f x +e \right )}{f}\) \(76\)
risch \(b^{2} x +\frac {4 i \left (-3 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-3 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+3 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-3 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+a^{2}-a b -2 b^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(94\)
parallelrisch \(\frac {3 x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) b^{2} f +\left (-6 a^{2}+6 b^{2}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-9 x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) b^{2} f +4 \left (a +b \right ) \left (a -5 b \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+9 x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) b^{2} f +\left (-6 a^{2}+6 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-3 b^{2} f x}{3 f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) \(159\)
norman \(\frac {b^{2} x \left (\tan ^{12}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+b^{2} x \left (\tan ^{14}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b^{2} x -b^{2} x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+3 b^{2} x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+3 b^{2} x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-3 b^{2} x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-3 b^{2} x \left (\tan ^{10}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {2 \left (a^{2}-b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {2 \left (a^{2}-b^{2}\right ) \left (\tan ^{13}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {8 \left (a^{2}+4 a b +3 b^{2}\right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {4 \left (5 a^{2}+4 a b -b^{2}\right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {4 \left (5 a^{2}+4 a b -b^{2}\right ) \left (\tan ^{11}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {2 \left (13 a^{2}+32 a b +19 b^{2}\right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {2 \left (13 a^{2}+32 a b +19 b^{2}\right ) \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{4}}\) \(357\)

[In]

int(sec(f*x+e)^4*(a+b*sin(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(-a^2*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)+2/3*a*b*sin(f*x+e)^3/cos(f*x+e)^3+b^2*(1/3*tan(f*x+e)^3-tan(f*x+e
)+f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.56 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {3 \, b^{2} f x \cos \left (f x + e\right )^{3} + {\left (2 \, {\left (a^{2} - a b - 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + a^{2} + 2 \, a b + b^{2}\right )} \sin \left (f x + e\right )}{3 \, f \cos \left (f x + e\right )^{3}} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/3*(3*b^2*f*x*cos(f*x + e)^3 + (2*(a^2 - a*b - 2*b^2)*cos(f*x + e)^2 + a^2 + 2*a*b + b^2)*sin(f*x + e))/(f*co
s(f*x + e)^3)

Sympy [F(-1)]

Timed out. \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\text {Timed out} \]

[In]

integrate(sec(f*x+e)**4*(a+b*sin(f*x+e)**2)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.44 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.18 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (f x + e\right )} b^{2} + 3 \, {\left (a^{2} - b^{2}\right )} \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/3*((a^2 + 2*a*b + b^2)*tan(f*x + e)^3 + 3*(f*x + e)*b^2 + 3*(a^2 - b^2)*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.64 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {a^{2} \tan \left (f x + e\right )^{3} + 2 \, a b \tan \left (f x + e\right )^{3} + b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (f x + e\right )} b^{2} + 3 \, a^{2} \tan \left (f x + e\right ) - 3 \, b^{2} \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/3*(a^2*tan(f*x + e)^3 + 2*a*b*tan(f*x + e)^3 + b^2*tan(f*x + e)^3 + 3*(f*x + e)*b^2 + 3*a^2*tan(f*x + e) - 3
*b^2*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 13.77 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.02 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right )^2 \, dx=\frac {\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,{\left (a+b\right )}^2}{3}-\mathrm {tan}\left (e+f\,x\right )\,\left ({\left (a+b\right )}^2-2\,a\,\left (a+b\right )\right )+b^2\,f\,x}{f} \]

[In]

int((a + b*sin(e + f*x)^2)^2/cos(e + f*x)^4,x)

[Out]

((tan(e + f*x)^3*(a + b)^2)/3 - tan(e + f*x)*((a + b)^2 - 2*a*(a + b)) + b^2*f*x)/f